<template>
	<div class="edit-gender">
		<van-picker
		  title="性别"
		  show-toolbar
		  :columns="columns"
		  :default-index="value"
		  @confirm="$emit('confirm',{'field':'gender','value':genderIndex})"
		  @cancel="$emit('close')"
		  @change="onChange"
		/>
	</div>
</template>

<script>
	import { Toast } from 'vant';
	export default {
		name:"editGender",
		data(){
			return {
				columns: ['男', '女'],
				genderIndex:0
			}
		},
		props:{
			value:{
				type:Number,
				default:0
			}
		},
		methods:{
			
			onChange(picker, value, index) {
			  this.genderIndex = index
			}
			
		}
	}
</script>

<style scoped lang="less">
	.edit-gender{}
</style>
